package cn.tedu.store.controller;

import java.io.File;
import java.io.IOException;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.multipart.MultipartFile;

@Controller
public class UploadFileController {
	
	@RequestMapping("/showUploadFile.do")
	public String showUploadFile(){
		return "upload";
	}
	@RequestMapping("/goUpload.do")
	public String goUpload(MultipartFile file) throws IllegalStateException, IOException{
		//获取上传文件名的名字
		String fileName=file.getOriginalFilename();
		System.out.println(fileName);
		File f=new  File("D:/",fileName);
		file.transferTo(f);
		return "index";
		
	}
}
